package com.dh.repository;

import com.dh.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserRepository extends JpaRepository<User, Long> {

    User findByUsernameAndDeleted(String username, byte deleted);

    Page<User> findByDeletedAndUserTypeAndNicknameContaining(byte deleted, byte userType, String nickname, Pageable pageable);

    Page<User> findByDeletedAndUserType(byte deleted, byte userType, Pageable pageable);

    List<User> findByDeletedAndUserType(byte deleted, byte userType);

}


